//
//  WGQTransfersRecordsSectionHeaderView.m
//  meiang_edu
//
//  Created by gq w on 2018/9/27.
//  Copyright © 2018年 com.meiang.meiang_edu. All rights reserved.
//

#import "WGQTransfersRecordsSectionHeaderView.h"

@interface WGQTransfersRecordsSectionHeaderView ()

@property (nonatomic,strong) UILabel * timeLabel;

@end


@implementation WGQTransfersRecordsSectionHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    UIView * backView = [[UIView alloc] initWithFrame:self.frame];
    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:backView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(7 * kScale, 7 * kScale)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = backView.bounds;
    maskLayer.path = maskPath.CGPath;
    backView.layer.mask = maskLayer;
    
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(12 * kScale, 12 * kScale, self.frame.size.width -12 * kScale, self.frame.size.height - 12 * kScale)];
    self.timeLabel.backgroundColor = [UIColor clearColor];
    self.timeLabel.textColor = FFColor(0xff9000);
    self.timeLabel.textAlignment = NSTextAlignmentLeft;
    self.timeLabel.font = [UIFont fontWithName:kMainFontFormat size:14 * kScale];
    [backView addSubview:self.timeLabel];
    
    [backView layoutIfNeeded];
}

- (void)changeTimeLabelTextWithYearStr:(NSString *)yearStr monthStr:(NSString *)monthStr
{
    self.timeLabel.text = [NSString stringWithFormat:@"%@年%@日",yearStr,monthStr];
}

@end
